package com.sms.biz.impl;

import java.util.List;

import com.sms.biz.IBlackListBiz;
import com.sms.dao.IBlackListDAO;
import com.sms.po.Blacklist;
/**
 * @author 20111006 by hzx
 */
public class BlackListBizImpl implements IBlackListBiz {
	private IBlackListDAO ibld = null;
	public void setIbld(IBlackListDAO ibld){ this.ibld = ibld; }
	@Override
	public List<Blacklist> showAllBlackList() {
		return ibld.showAllBlackList();
	}

	@Override
	public List<Blacklist> showAllBlackListByPage(int start, int limit) {
		if (start <= 0) {start = 0;		}
		if (limit <= 0) {limit = 10;	}
		// 分页获取黑名单信息
		return ibld.showAllBlackListByPage(start, limit);
	}
	@Override
	public int getAllBlackListCount() {
		return ibld.getAllBlackListCount();
	}
	@Override
	public boolean addBlackList(Blacklist bl) {
		try {
			return ibld.addBlackList(bl);
		} catch (Exception e) {
			return false;
		}
	}
	@Override
	public boolean removeBlackList(Blacklist bl) {
		try{
			return ibld.removeBlackList(bl);
		} catch (Exception e) {
			return false;
		}
	}
	@Override
	public boolean updateBlackList(Blacklist bl) {
		return ibld.updateBlackList(bl);
	}
	
	public List<Blacklist> showUserBlackList(String userId) {
		return ibld.showUserBlackList(userId);
	}
	
	public boolean isBlacklist(String userId,String phone){
		return ibld.isBlacklist(userId, phone);
	}
}
